﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using PloobsEngine.SceneControl;
using PloobsEngine.Material;
using PloobsEngine.Physics;
using PloobsEngine.Modelo;
using PloobsEngine.Draw;
using PloobsEngine.Light;
using PloobsEngine.Cameras;

namespace Etapa1.Pedestrian
{
    /// <summary>
    /// WILL CHANGE
    /// </summary>
    public class BepuSteerAgent : SimpleObject
    {

        Bnoerj.AI.Steering.SimpleVehicle p;

        public BepuSteerAgent(Bnoerj.AI.Steering.SimpleVehicle p, IMaterial mat, IPhysicObject pi, IModelo model)
            : base(mat, pi, model)
        {
            this.p = p;
        }

        public override void UpdateObject(Microsoft.Xna.Framework.GameTime gt, ICamera cam, IList<ILight> luzes)
        {
            Drawing.Draw3dLine(p.SmoothedPosition, p.SmoothedPosition + p.Forward * 50, Color.Green);            
            PhysicObject.Position = p.SmoothedPosition;
            base.UpdateObject(gt, cam, luzes);
        }

        public override Microsoft.Xna.Framework.Vector3 Position
        {
            get
            {
                return p.SmoothedPosition;
            }
            set
            {
                p.Position = value;
            }
        }

        public override Microsoft.Xna.Framework.Matrix Rotation
        {
            get
            {
                return Matrix.Identity;
            }
            set
            {
                base.Rotation = value;
            }
        }

        public override Microsoft.Xna.Framework.Vector3 Scale
        {
            get
            {
                return base.Scale;
            }
            set
            {
                base.Scale = value;
            }
        }

        public override Microsoft.Xna.Framework.Matrix getWorldMatrix()
        {
            return Matrix.CreateScale(Scale) * Rotation * Matrix.CreateTranslation(Position);
        }
      
    }

}
